package com.unisound.tracelog.common.model.span;

import java.util.Map;

public class EndSpan {
    private StartSpanResult startSpanResult;

    private Object result;

    private Integer resultFlag = 0;
    private Map<String, String> errorMessageMap;

    public EndSpan() {
    }

    public EndSpan(StartSpanResult startSpanResult, Object result, Integer resultFlag, Map<String, String> errorMessageMap) {
        this.startSpanResult = startSpanResult;
        this.result = result;
        this.resultFlag = resultFlag;
        this.errorMessageMap = errorMessageMap;
    }

    public EndSpan(StartSpanResult startSpanResult, Map<String, String> errorMessageMap) {
        this.startSpanResult = startSpanResult;
        this.errorMessageMap = errorMessageMap;
        this.resultFlag = 1;
    }

    public EndSpan(StartSpanResult startSpanResult, Object result) {
        this.startSpanResult = startSpanResult;
        this.result = result;
    }

    public StartSpanResult getStartSpanResult() {
        return startSpanResult;
    }

    public void setStartSpanResult(StartSpanResult startSpanResult) {
        this.startSpanResult = startSpanResult;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public Integer getResultFlag() {
        return resultFlag;
    }

    public void setResultFlag(Integer resultFlag) {
        this.resultFlag = resultFlag;
    }

    public Map<String, String> getErrorMessageMap() {
        return errorMessageMap;
    }

    public void setErrorMessageMap(Map<String, String> errorMessageMap) {
        this.errorMessageMap = errorMessageMap;
    }
}
